#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void print(int arr[],int sz)
{
    int i = 0;
	for(i=0;i<sz;i++)
	{
	    printf("%d ",arr[i]);
	}
	printf("\n");
}
void move_even_odd(int arr[],int sz)
{
    int left = 0;
	int right = sz - 1;
	int tmp = 0;
	while(left<right)
	{
		while((left<right) && (arr[left] %2 != 0))
		{
		    left++;
		}
		while((left<right) && (arr[right] %2 == 0))
		{
		    right--;
		}
		if(left<right)
		{
		    tmp = arr[left];
			arr[left] = arr[right];
			arr[right] = tmp;
		}
	}
}
int main()
{
	int arr[] = {1,2,3,4,5,6,7,8,9,10};
	int sz = sizeof(arr)/sizeof(arr[0]);
	print(arr,sz);
	move_even_odd(arr,sz);
	print(arr,sz);
    return 0;
}